#!/usr/bin/python
# import json
#
# data = [{'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5}]
# color = '黄'
# data2 = json.dumps(color)
#
#
# print(data2)
# 导入请求包
import requests
# 导入json包
import json

def send_result_feign(camera_index_code,result):
    # 设置要访问的地址（这里是get请求）
    url = 'http://192.168.1.195:9090/radio/result'
    # 定一个字典类型
    mapA = {"camera_index_code": camera_index_code, "result": result}
    # 把字典转成字符串
    str = json.dumps(mapA)
    # 这里得给设置一个请求格式，不然会返回415
    # header_dict = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko',"Content-Type": "application/json"}
    header_dict = {"Content-Type": "application/json; charset=utf8"}
    print(str)
    # 直接请求
    r = requests.post(url, data=str, headers=header_dict)
    # 这里是输出了一个字符串
    print(r.text)

# list3 = ["a", "b", "c", "d"]
# send_result_feign('E2912123',list3)

s = 'aaa'
print(str(s))